<div>
    <h2 data-translate="milkbeeApp.card.home.title">Cards</h2>
    <jhi-alert></jhi-alert>
    <br/>
    <ul class="nav nav-tabs">
		<li role="presentation" ng-class="{'active':vm.stat==1}"><a ui-sref="card({stat:'1'})" data-translate="milkbeeApp.card.state.all">ALL</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==2}"><a ui-sref="card({stat:'2'})" data-translate="milkbeeApp.card.state.report">REPORT</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==3}"><a ui-sref="card({stat:'3'})" data-translate="milkbeeApp.card.state.home">HOME</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==4}"><a ui-sref="card({stat:'4'})" data-translate="milkbeeApp.card.state.essence">ESSENCE</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==5}"><a ui-sref="card({stat:'5'})" data-translate="milkbeeApp.card.state.applyessence">APPLY ESSENCE</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==6}"><a ui-sref="card({stat:'6'})" data-translate="milkbeeApp.card.state.denyessence">DENY ESSENCE</a></li>
		<li role="presentation" ng-class="{'active':vm.stat==7}"><a ui-sref="card({stat:'7'})" data-translate="milkbeeApp.card.state.attachment">ATTACHMENT</a></li>
	</ul>
    <div class="table-responsive">
        <table class="jh-table table table-striped">
            <thead>
                <tr jh-sort="vm.predicate" ascending="vm.reverse" callback="vm.transition()">
                    <!-- <th jh-sort-by="id"><span data-translate="global.field.id">ID</span> <span class="glyphicon glyphicon-sort"></span></th>
                     -->
                    <th jh-sort-by="title"><span data-translate="milkbeeApp.card.title">Title</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="createdAt"><span data-translate="milkbeeApp.card.createdAt">Created At</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="userId"><span data-translate="milkbeeApp.card.userId">User Id</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="categoryId"><span data-translate="milkbeeApp.card.categoryId">Category Id</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="commentCount"><span data-translate="milkbeeApp.card.commentCount">Comment Count</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="attachment"><span data-translate="milkbeeApp.card.attachment">Attachment</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="accusation"><span data-translate="milkbeeApp.card.accusation">Accusation</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="look"><span data-translate="milkbeeApp.card.look">Look</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="download"><span data-translate="milkbeeApp.card.download">Download</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="light"><span data-translate="milkbeeApp.card.light">Light</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="essence"><span data-translate="milkbeeApp.card.essence">Essence</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th jh-sort-by="recommend"><span data-translate="milkbeeApp.card.recommend">recommend</span> <span class="glyphicon glyphicon-sort"></span></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="card in vm.cards track by card.id">
                   <!--  <td><a ui-sref="card-detail({id:card.id})">{{card.id}}</a></td>
                    --> 
                    <td><a ui-sref="cardcoments({cardId:card.id,cardTitle:card.title})" >{{card.title}}</a></td>
                    <td>{{card.createdAt | date:'medium'}}</td>
                    <td><a ui-sref="leaguer-detail({id:card.leaguerId})">{{card.userId}}</a></td>
                    <td>{{card.categoryId}}</td>
                    <td>{{card.commentCount}}</td>
                    <td><span ng-if="card.attachment" style="color:silver;" class="glyphicon glyphicon-paperclip" /></td>
                    <td><span ng-if="card.accusation>0" style="color:red;" class="glyphicon glyphicon-exclamation-sign"></span>{{card.accusation}}</td>
                    <td>{{card.look}}</td>
                    <td>{{card.download}}</td>
                    <td>{{card.light}}</td>
                    <td>
                    	<span ng-if="card.essence>2" style="color:green;"  class="glyphicon glyphicon-thumbs-up"></span>
                    	<span ng-if="card.essence==2" style="color:orange;"  class="glyphicon glyphicon-thumbs-up"></span>
                    	<span ng-if="card.essence==1" style="color:red;"  class="glyphicon glyphicon-thumbs-down"></span>
                    </td>
                    <td><span ng-if="card.recommend" style="color:green;"  class="glyphicon glyphicon-home"></span></td>
                    <td class="text-right">
                        <div class="btn-group flex-btn-group-container">
                           <!--  <button type="submit"
                                    ui-sref="card-detail({id:card.id})"
                                    class="btn btn-info btn-sm">
                                <span class="glyphicon glyphicon-eye-open"></span>
                                <span class="hidden-xs hidden-sm" data-translate="entity.action.view"></span>
                            </button>-->
                            <button ng-if="card.recommend==false" type="submit"
                                    ui-sref="card.home({id:card.id})"
                                    class="btn btn-primary btn-sm">
                                <span class="glyphicon glyphicon-home"></span>
                                <span class="hidden-xs hidden-sm" data-translate="milkbeeApp.card.action.home"></span>
                            </button>
                            <button ng-if="card.recommend" type="submit"
                                    ng-click="vm.cancel({id:card.id})"
                                    class="btn btn-info btn-sm">
                                <span style="color:gray;" class="glyphicon glyphicon-home"></span>
                                <span class="hidden-xs hidden-sm" data-translate="milkbeeApp.card.action.cancelhome"></span>
                            </button>
                            <button type="submit"
                                    ui-sref="card.delete({id:card.id})"
                                    class="btn btn-danger btn-sm">
                                <span class="glyphicon glyphicon-remove-circle"></span>
                                <span class="hidden-xs hidden-sm" data-translate="entity.action.delete"></span>
                            </button>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="text-center">
        <jhi-item-count page="vm.page" total="vm.queryCount" items-per-page="vm.itemsPerPage"></jhi-item-count>
        <uib-pagination class="pagination-sm" total-items="vm.totalItems" items-per-page="vm.itemsPerPage" ng-model="vm.page" ng-change="vm.transition()"></uib-pagination>
    </div>
</div>
